package com.cooud.common;

import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: DongGuoZhen
 * @Date: 2025/03/16/16:32
 * @Description:
 */
@Data
public class R {

    private Integer code;
    private String msg;
    private Object data;


    public static R success() {
        R r = new R();
        r.setCode(200);
        return r;
    }

    public static R error() {
        R r = new R();
        r.setCode(500);
        return r;
    }

    public static R error(Integer code , String msg, Object data) {
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }

    public static R ok(String msg) {
        R r = new R();
        r.setCode(200);
        r.setMsg(msg);
        return r;
    }
}
